package com.xmg.mgrsite.base;

import com.xmg.p2p.base.util.JSONResult;
import com.xmg.p2p.business.domain.RechargeOffline;
import com.xmg.p2p.business.query.RechargeOfflineQueryObject;
import com.xmg.p2p.business.service.IPlatformBankInfoService;
import com.xmg.p2p.business.service.IRechargeOfflineService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * lcd  2020/5/27
 * Description:后台审核
 */
@Controller
public class RechargeOfflineController {
    @Autowired
    private IPlatformBankInfoService platformBankInfoService;
    @Autowired
    private IRechargeOfflineService rechargeOfflineService;

    @RequestMapping("rechargeOffline")
    public String rechargeOffline(Model model, @ModelAttribute("qo")RechargeOfflineQueryObject qo) {
        //banks
        model.addAttribute("banks", platformBankInfoService.findAll());
        model.addAttribute("pageResult", rechargeOfflineService.query(qo));
        return "rechargeoffline/list";
    }
    //审核充值情况
    @RequestMapping("rechargeOffline_audit")
    @ResponseBody
    public JSONResult audit(long id,int state,String remark){
        rechargeOfflineService.audit(id,state,remark);
        return new JSONResult();
    }
}
